<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>基础数据管理-项目信息新增</title>
    <script src="/scripts/boot.js"></script>
</head>
<body class="bg-white">
<div id="viewForm">
    <div class="title-info mb-20"><span>基本信息</span></div>
    <table class="table-bg" border="0" cellpadding="1" cellspacing="1" style="width:100%;table-layout:fixed;">
        <colgroup>
            <col width="135px"></col>
            <col width="50%"></col>
            <col width="135px"></col>
            <col width="50%"></col>
        </colgroup>
        <tr>
            <td class="text-titlebg">状态</td>
            <td colspan="3">
                <div class="input-div color-66" id="fullName"></div>
            </td>
        </tr>
        <tr>
            <td class="text-titlebg">工期大于等于</td>
            <td>
                <div class="input-div color-66" id="number"></div>
                <!--<input type="text" name="number" class="mini-textbox w220" required="true" errorMode="none" onvalidation="onEnglishAndNumberValidation" requiredErrorText="请输入" vtype="maxLength:48"/>-->
            </td>
            <td class="text-titlebg">进度小于</td>
            <td>
                <div class="input-div color-66" id="name"></div>
           		<!--<input type="text" name="name" class="mini-textbox w220" required="true" errorMode="none" onvalidation="onNullValidation" requiredErrorText="请输入" vtype="maxLength:48"/>-->
            </td>
        </tr>
        <tr>
            <td class="text-titlebg noEmpty">说明</td>
            <td colspan="3">
                <div class="textarea-div color-66" id="itemDescription"></div>
                <!--<textarea name="itemDescription" class="mini-textarea wtextarea" emptyText="" errorMode="none" onvalidation="onNullValidation" required="true" requiredErrorText="请选择"></textarea>-->
            </td>
        </tr>
    </table>
    <div class="chose-toolbar">
        <a class="chose-button" onclick="CloseWindow('close')">关闭</a>
        <!-- <a class="chose-button save-button" onclick="view.save()">保存</a> -->
    </div>
</div>
<script type="text/javascript">
var post_flag,form;
var view = {
    init: function () {
        post_flag = false; //设置一个对象来控制是否进入AJAX过程
        mini.parse();
        form = new mini.Form("#viewForm");
    },
//    数据展示
    SetData: function (data) {
        data = mini.clone(data);
        $.ajax({
            url:"/item/info?id=" + data.id,
            type: "post",
            success: function (text) {
                //跨页面传递的数据对象，克隆后才可以安全使用
                var datas = mini.decode(text);   //反序列化成对象
                $.each(datas,function (key,value) {
                    $("#"+key).html(value);
                    if(key=="tSysNation"){
                        $("#fullName").html(value.fullName);
                    }
                    if(key=="itemStartDate"){
                        var data = value.substring(0,10);
                        $("#itemStartDate").html(data);
                    }
                    if(key=="itemEndDate"){
                        var data = value.substring(0,10);
                        $("#itemEndDate").html(data);
                    }
                    if(key=="workStartDate"){
                        var data = value.substring(0,10);
                        $("#workStartDate").html(data);
                    }
                    if(key=="workEndDate"){
                        var data = value.substring(0,10);
                        $("#workEndDate").html(data);
                    }
                    if(key=="openDate"){
                        var data = value.substring(0,10);
                        $("#openDate").html(data);
                    }
                    if(key=="sealDate"){
                        var data = value.substring(0,10);
                        $("#sealDate").html(data);
                    }
                    if(key=="status"){
                    	var data;
                    	if(value==0){
                    		data = "开建";
                    	}else if(value==1){
                    		data = "暂停";
                    	}else if(value==2){
                    		data = "搁置";
                    	}else {
                    		data = "结案";
                    	}
                    	$("#status").html(data)
                    }
                });
            }
        });
    }
};
view.init();
</script>
</body>
</html>